﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ProjectBase.Core;

namespace $safeprojectname$
{
    public class ServiceMessage
    {
        IList<ClientMessage> _messages;
        public IList<ClientMessage> Messages
        {
            get { return _messages ?? (_messages = new List<ClientMessage>()); }
            set { _messages = value; }
        }

        public ServiceMessage Add(Severity severity, string description)
        {
            return Add(severity.ToString(), description);
        }

        public ServiceMessage Add(string severity, string description)
        {
            var message = new ClientMessage
            {
                Severity = (severity ?? string.Empty).ToUpperInvariant(),
                Description = description,
            };
            Messages.Add(message);
            return this;
        }

        public class ClientMessage
        {
            public string Severity { get; set; }
            public string Description { get; set; }
        }
    }
}
